package com.orange.score.activity.more;

import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.orange.score.activity.entry.PageableAdapter;
import com.orange.score.model.match.Match;
import java.util.List;

public class WeeklyScheduleAdapter extends PageableAdapter<Match>
{
  public WeeklyScheduleAdapter(List<Match> paramList, Context paramContext)
  {
    super(paramList, paramContext);
  }

  private String getDateFromString(String paramString)
  {
    String str;
    if ((paramString == null) || (paramString.length() < 12))
      str = "";
    while (true)
    {
      return str;
      Object[] arrayOfObject = new Object[3];
      arrayOfObject[0] = paramString.substring(6, 8);
      arrayOfObject[1] = paramString.substring(8, 10);
      arrayOfObject[2] = paramString.substring(10, 12);
      str = String.format("%s日%s:%s", arrayOfObject);
    }
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    Holder localHolder;
    View localView;
    if (paramView != null)
    {
      localHolder = (Holder)paramView.getTag();
      if (paramInt % 2 != 0)
        break label148;
      paramView.setBackgroundColor(this.context.getResources().getColor(2131230739));
      if (paramInt + this.startIndex < this.list.size())
        break label167;
      localView = null;
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          return localView;
          localHolder = new Holder(this);
          paramView = LayoutInflater.from(this.context).inflate(2130903079, null);
          localHolder.leagueName = ((TextView)paramView.findViewById(2131558487));
          localHolder.date = ((TextView)paramView.findViewById(2131558488));
          localHolder.homeTeamName = ((TextView)paramView.findViewById(2131558489));
          localHolder.awayTeamName = ((TextView)paramView.findViewById(2131558491));
          paramView.setTag(localHolder);
        }
        label148: paramView.setBackgroundColor(this.context.getResources().getColor(2131230746));
      }
      label167: Match localMatch = (Match)this.list.get(paramInt + this.startIndex);
      localHolder.homeTeamName.setText(localMatch.getHomeTeamName());
      localHolder.awayTeamName.setText(localMatch.getAwayTeamName());
      localHolder.leagueName.setText(localMatch.getLeagueName());
      String str = getDateFromString(localMatch.getDate());
      localHolder.date.setText(str);
      localView = paramView;
    }
  }

  class Holder
  {
    TextView awayTeamName;
    TextView date;
    TextView homeTeamName;
    TextView leagueName;
  }
}